package net.chrisrichardson.ec2deployer.util

class FileBasedTemplate {

    def engine = new groovy.text.SimpleTemplateEngine()
    
    String process(String templateName, Map params) {
        InputStream stream = getClass().getResourceAsStream(templateName)
        assert stream : "Can't find template: $templateName"
        engine.createTemplate(new InputStreamReader(stream)).make(params).toString()
    }
}